package com.fancy.learncenter.ui.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.facebook.drawee.view.SimpleDraweeView;
import com.fancy.learncenter.R;
import com.fancy.learncenter.bean.BookStoreDataBean;
import com.fancy.learncenter.common.Constant;
import com.fancy.learncenter.ui.activity.base.MallCommonH5Activity;
import com.fancy.learncenter.ui.adapter.base.CommonRecycleViewAdapter;
import com.fancy.learncenter.ui.adapter.base.CustomViewHold;

import java.util.List;

/**
 * Created by Hyy on 2016/12/27.
 */

public class FragmentBoosStoreEdenAdapter extends CommonRecycleViewAdapter<BookStoreDataBean.GardenEnjoyBean> {
    Context mContext;

    public FragmentBoosStoreEdenAdapter(Context mContext, List<BookStoreDataBean.GardenEnjoyBean> itemDatas) {
        super(mContext, R.layout.fragment_bookstore_eden_item, itemDatas);
        this.mContext = mContext;
    }

    @Override
    public void bindView(CustomViewHold customViewHold, final BookStoreDataBean.GardenEnjoyBean item, int position) {
        SimpleDraweeView simpleDraweeView = customViewHold.getView(R.id.simpleDraweeView);
        simpleDraweeView.setImageURI(item.getImg());

        customViewHold.getRoorView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, MallCommonH5Activity.class);

                intent.putExtra(MallCommonH5Activity.URL_KEY, item.getLink());

                mContext.startActivity(intent);
            }
        });

    }
}
